package com.abbas.CayTcore.presenter

import com.abbas.CayTcore.base.BasePresenter
import com.abbas.CayTcore.entity.TCoreBase
import com.abbas.CayTcore.model.CoreDetailModel
import com.abbas.CayTcore.view.ViewContract

class CoreDetailPresenter: BasePresenter<ViewContract.CoreDetailView, CoreDetailModel>() {
    override fun initModel(): CoreDetailModel {
        return CoreDetailModel()
    }

    fun updateCore(core: TCoreBase){
        model.updateCore(core,{
                              view.get()?.onCoreUpdate()
        },{
            view.get()?.showToast(it.stackTraceToString())
        })
    }

    fun deleteCore(core: TCoreBase){
        model.deleteCore(core,{

        },{
            view.get()?.showToast(it.stackTraceToString())
        })
    }
}